main(List<String> args) {
  var p = Person.withNameAgeHeight('zm', 5, 0.618);

  var p1 = Person.fromMap({'name': 'zm', 'age': 5, 'height': 0.618});

  print(p1);

  //
  // Object obj = 'why';
  // print(obj.substring(1));

  dynamic obj = 'zm';
  // print(obj.substring(1));
}

class Person {
  late String name;
  late int age;
  late double height;

  Person(String this.name, int this.age);
  // Person(String this.name, int this.age, double this.height);

  // 命名构造函数
  Person.withNameAgeHeight(String this.name, int this.age, double this.height);
  Person.fromMap(Map<String, dynamic> map) {
    this.name = map['name'];
    this.age = map['age'];
    this.height = map['height'];
  }

  @override
  String toString() {
    return '$name $age $height';
  }
}
